<template>
  <div>
    <h1>info item detail</h1>
  </div>
</template>

<script>
import PubSub from "pubsub-js";
export default {
  name: "InfoItemDetail",
  props: [""],
  data() {
    return {};
  },

  components: {},

  computed: {},

  beforeMount() {},

  mounted() {
    //订阅消息
    PubSub.subscribe("showInfo", (msg, list) => {
      console.log(list);
    });
  },

  methods: {},

  watch: {}
};
/* 
消息订阅发布  借助 pubsub-js库  任意组件传值
①安装 npm i -S pubsub-js
②哪个组件使用消息订阅发布哪个组件引入pubsub库
③发布消息PubSub.publish(事件名，传递的参数)
④订阅消息PubSub.subscribe(事件名，回调函数)  注意：回调函数上的msg，必须写， 否则不能得到数据 



*/
</script>

<style lang="" scoped>
/* scoped css只在当前组件生效 */
</style>
